﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ESLab1
{
    public partial class Main : Form
    {
        RuleExec rules;
        public Main()
        {
            InitializeComponent();
        }

        private void консультацияToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void справкаToolStripMenuItem_Click(object sender, EventArgs e)
        {
            About fm = new About();
            fm.ShowDialog();
        }

        private void обратнаяЦепочкаToolStripMenuItem_Click(object sender, EventArgs e)
        {
            rules = new RuleExec("rules1.xml", this);
            rules.ReadBZ();
        }

        private void выходToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void Main_FormClosing(object sender, FormClosingEventArgs e)
        {
            DialogResult dr = MessageBox.Show("Вы действительно хотите выйти?", "Выход", MessageBoxButtons.YesNo);
            if (dr == DialogResult.No)
                e.Cancel = true;
        }

		private void прямаяЦепочкаToolStripMenuItem_Click(object sender, EventArgs e)
		{
			rules = new RuleExec("rules1.xml", this);
			rules.ReadBZFC();
		}

        private void просмотрРезультатаToolStripMenuItem_Click(object sender, EventArgs e)
        {
            rules.ShowExplanation(RuleExec.lastRule);            

        }
    }
}
